<?
//Sinh ra danh sach ho so
function Generate_Record_List($arr_all_item,$p_table_struct_xml_string,$p_title_list,$p_colume_value_of_xml_string){
	global $v_value,$v_url,$v_align,$v_inc,$v_selectbox_option_sql,$v_php_function;
	$v_current_style_name = "odd_row";
	$v_count = sizeof($arr_all_item);
	$v_style_file = "../../isa-lib/isa-style/isa_style.css";
	$v_str_style = _read_file($v_style_file);
	//Phan dau cua chuoi html
	$v_html_content = '<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">';
	$v_html_content = $v_html_content.'<style type=text/css><!--'.$v_str_style.'--></style>';
	//Bat dau cua danh sach
	$v_html_string = '';
	$v_html_string = $v_html_string  . '<table width="100%" cellpadding="0" cellspacing="0">';
	$v_html_string = $v_html_string  . '<tr><td colspan="10" class="normal_title">'.$p_title_list.'</td><tr>';
	$v_html_string = $v_html_string  . '</table>';
	$v_html_string = $v_html_string  . '<table class="list_table2" width="100%" cellpadding="0" cellspacing="0">';
	$table_struct_rax = new RAX(); 
	$table_struct_rec = new RAX(); 
	$table_struct_rax->open($p_table_struct_xml_string);
	$table_struct_rax->record_delim = 'col';
	$table_struct_rax->parse();
	$table_struct_rec = $table_struct_rax->readRecord(); 
	$v_html_temp_width = '';
	$v_html_temp_label = '';
	$v_column = 0;
	while ($table_struct_rec) { 
		$table_struct_row = $table_struct_rec->getRow();
		$v_label = $table_struct_row["label"];
		$v_width = $table_struct_row["width"];
		$v_html_temp_width = $v_html_temp_width  . '<col width="'.$v_width .'">';
		$v_html_temp_label = $v_html_temp_label . '<td align="center">'.$v_label.'</td>';
		$table_struct_rec = $table_struct_rax->readRecord();
		$v_column ++;
	}
	$v_html_string = $v_html_string  . $v_html_temp_width;
	$v_html_string = $v_html_string  . '<tr class="header">';
	$v_html_string = $v_html_string  . $v_html_temp_label;
	$v_html_string = $v_html_string  . '</tr></table>';
	$v_html_string = $v_html_string  . '<div style="overflow: auto; width: 100%; height:180pt;padding-left:0px;margin:0px">';
	$v_html_string = $v_html_string  . '<table class="list_table2" width="100%" cellpadding="0" cellspacing="0">';
	$v_html_string = $v_html_string  . $v_html_temp_width;
	if ($v_count >0){
		for($row_index = 0;$row_index< $v_count ;$row_index++){
			$v_url = "";
			$v_received_record_xml_data = $arr_all_item[$row_index][$p_colume_value_of_xml_string];
			if ($v_current_style_name == "odd_row"){
				$v_current_style_name = "round_row";
			}else{
				$v_current_style_name = "odd_row";
			}
			$v_inc = $row_index+1;
			$v_html_string = $v_html_string  .'<tr class="'.$v_current_style_name.'" >'; 
			$table_struct_rax = new RAX(); 
			$table_struct_rec = new RAX(); 
			$table_struct_rax->open($p_table_struct_xml_string);
			$table_struct_rax->record_delim = 'col';
			$table_struct_rax->parse();
			$table_struct_rec = $table_struct_rax->readRecord(); 
			while ($table_struct_rec) { 
				$table_struct_row = $table_struct_rec->getRow();
				$v_type = $table_struct_row["type"];
				$v_width = $table_struct_row["width"];
				$v_align = $table_struct_row["align"];
				$v_xml_data = $table_struct_row["xml_data"];
				$v_column_name = $table_struct_row["column_name"];
				$v_xml_tag_in_db = $table_struct_row["xml_tag_in_db"];
				$v_php_function = $table_struct_row["php_function"];
				if ($v_xml_data=="true"){
					$column_rax = new RAX(); 
					$column_rec = new RAX();
					$column_rax->open($v_received_record_xml_data);
					$column_rax->record_delim = 'data_list';
					$column_rax->parse();
					$column_rec = $column_rax->readRecord(); 
					$column_row = $column_rec->getRow();
					$v_value = _restore_XML_bad_char($column_row[$v_xml_tag_in_db]);
					$v_html_string = $v_html_string  . Element_Type($v_type); 
				}else{
					$v_value = $arr_all_item[$row_index][$v_column_name];
					if ($v_type=="checkbox"){
						$v_type = "identity";				
					}
					$v_html_string = $v_html_string  . Element_Type($v_type); 
				}
				$table_struct_rec = $table_struct_rax->readRecord();
			}
			$v_html_string = $v_html_string  .'</tr>';
		}
	}
	if ($v_current_style_name == "odd_row"){
		$v_next_style_name = "round_row";
	}else{
		$v_next_style_name = "odd_row";
	}
	$v_html_string = $v_html_string  . _add_empty_row($v_count,10,$v_current_style_name,$v_next_style_name,$v_column);
	$v_html_string = $v_html_string  .'</table></div>';
	$v_html_content = $v_html_content.'</head><body>'.$v_html_string.'</body>';
	$v_html_content = $v_html_content.'</html>';
	return $v_html_content;
}
function get_text_record_net_status($v_value){
	//Khai bao cac mang dung cho danh sach don vi trien khai
	$arr_status_of_record_net[0][0] = 0;
	$arr_status_of_record_net[0][1] = "Ch&#432;a &#273;&#432;&#7907;c ti&#7871;p nh&#7853;n";
	$arr_status_of_record_net[1][0] = 1;
	$arr_status_of_record_net[1][1] = "&#272;&#432;&#7907;c ti&#7871;p nh&#7853;n";
	$arr_status_of_record_net[2][0] = 2;
	$arr_status_of_record_net[2][1] = "Phai thay &#273;&#7893;i";
	$arr_status_of_record_net[3][0] = 9;
	$arr_status_of_record_net[3][1] = "&#272;&#227; ti&#7871;p nh&#7853;n h&#7891; s&#417; gi&#7845;y";
	for ($i=0;$i<sizeof($arr_status_of_record_net);$i++){
		if ($arr_status_of_record_net[$i]['0'] == $v_value){
			return $arr_status_of_record_net[$i]['1'];
		}
	}
	return "";
}
?>